home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / PInterface Translator / PInterfaces / AppleEvents.p < prev    next >
Encoding:
Text File  |  1993-09-16  |  23.6 KB  |  598 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Friday, January 11, 1991 at 3:01 PM
  3.     AppleEvents.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.         Copyright Apple Computer, Inc.    1989-1990
  7.         All rights reserved
  8.     
  9. }
  10.  
  11.  
  12. {$IFC UNDEFINED UsingIncludes}
  13. {$SETC UsingIncludes := 0}
  14. {$ENDC}
  15.  
  16. {$IFC NOT UsingIncludes}
  17.     UNIT AppleEvents;
  18.     INTERFACE
  19. {$ENDC}
  20.  
  21. {$IFC UNDEFINED UsingAppleEvents}
  22. {$SETC UsingAppleEvents := 1}
  23.  
  24. {$I+}
  25. {$SETC AppleEventsIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingTypes}
  28. {$I $$Shell(PInterfaces)Types.p}
  29. {$ENDC}
  30. {$IFC UNDEFINED UsingMemory}
  31. {$I $$Shell(PInterfaces)Memory.p}
  32. {$ENDC}
  33. {$IFC UNDEFINED UsingOSUtils}
  34. {$I $$Shell(PInterfaces)OSUtils.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED UsingEvents}
  37. {$I $$Shell(PInterfaces)Events.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED UsingEPPC}
  40. {$I $$Shell(PInterfaces)EPPC.p}
  41. {$ENDC}
  42. {$IFC UNDEFINED UsingNotification}
  43. {$I $$Shell(PInterfaces)Notification.p}
  44. {$ENDC}
  45. {$SETC UsingIncludes := AppleEventsIncludes}
  46.  
  47. CONST
  48. typeBoolean = 'bool';
  49. typeChar = 'TEXT';
  50. typeSMInt = 'shor';
  51. typeInteger = 'long';
  52. typeSMFloat = 'sing';
  53. typeFloat = 'doub';
  54. typeLongInteger = 'long';
  55. typeShortInteger = 'shor';
  56. typeLongFloat = 'doub';
  57. typeShortFloat = 'sing';
  58. typeExtended = 'exte';
  59. typeComp = 'comp';
  60. typeMagnitude = 'magn';
  61. typeAEList = 'list';
  62. typeAERecord = 'reco';
  63. typeTrue = 'true';
  64. typeFalse = 'fals';
  65. typeAlias = 'alis';
  66. typeEnumerated = 'enum';
  67. typeType = 'type';
  68. typeAppParameters = 'appa';
  69. typeProperty = 'prop';
  70. typeFSS = 'fss ';
  71. typeKeyword = 'keyw';
  72. typeSectionH = 'sect';
  73. typeWildCard = '****';
  74.  
  75. typeApplSignature = 'sign';
  76. typeSessionID = 'ssid';
  77. typeTargetID = 'targ';
  78. typeProcessSerialNumber = 'psn ';
  79. typeNull = 'null';                  {the type of null/nonexistent data}
  80.  
  81. kCoreEventClass = 'aevt';
  82.  
  83. kAEOpenApplication = 'oapp';
  84. kAEOpenDocuments = 'odoc';
  85. kAEPrintDocuments = 'pdoc';
  86. kAEQuitApplication = 'quit';
  87.  
  88. kAECreatorType = 'crea';
  89. kAEQuitAll = 'quia';
  90. kAEShutDown = 'shut';
  91. kAERestart = 'rest';
  92. kAEApplicationDied = 'obit';
  93. keyProcessSerialNumber = 'psn ';
  94.  
  95. keyErrorNumber = 'errn';
  96. keyErrorString = 'errs';
  97.  
  98. kAEAnswer = 'ansr';
  99.  
  100. keyDirectObject = '----';
  101.  
  102.  
  103. { keyword used in install special handler }
  104. keyPreDispatch = 'phac';            { PreHandler Accessor Call }
  105. keySelectProc = 'selh';             { More selector Call }
  106.  
  107. { keywords used in attributes }
  108. keyTransactionIDAttr = 'tran';
  109. keyReturnIDAttr = 'rtid';
  110. keyEventClassAttr = 'evcl';
  111. keyEventIDAttr = 'evid';
  112. keyAddressAttr = 'addr';
  113. keyOptionalKeywordAttr = 'optk';
  114. keyTimeoutAttr = 'timo';
  115. keyInteractLevelAttr = 'inte';      {this attribute is read only will be set in AESend}
  116. keyEventSourceAttr = 'esrc';        { this attribute is read only }
  117. keyMissedKeywordAttr = 'miss';      { this attribute is read only }
  118.  
  119. { constants for use in AESendMode }
  120. kAENoReply = $00000001;             { Sender doesn't want a reply to event }
  121. kAEQueueReply = $00000002;          { Sender wants a reply but won't wait }
  122. kAEWaitReply = $00000003;           { Sender wants a reply and will be waiting }
  123.  
  124. kAENeverInteract = $00000010;       { Server should not interact with user }
  125. kAECanInteract = $00000020;         { Server may try to interact with user }
  126. kAEAlwaysInteract = $00000030;      { Server should always interact with user where appropriate }
  127.  
  128. kAECanSwitchLayer = $00000040;      { Interaction may switch layer }
  129.  
  130. kAEDontReconnect = $00000080;       { don't reconnect if there is a sessClosedErr from PPCToolbox }
  131.  
  132. kAEWantReceipt = nReturnReceipt;    { Send wants a receipt of message }
  133.  
  134. { constants to be used in AESendPriority }
  135. kAENormalPriority = $00000000;      { Post message at the end of event queue }
  136. kAEHighPriority = nAttnMsg;         { Post message at the front of the event queue }
  137.  
  138. { special constants in generating events }
  139. kAnyTransactionID = 0;              { no transaction is in use }
  140. kAutoGenerateReturnID = -1;         { AECreateAppleEvent will generate a session-unique ID }
  141.  
  142. { constant for use AESend }
  143. kAEDefaultTimeout = -1;             { timeout value determined by AEM }
  144. kNoTimeOut = -2;                    { wait until reply comes back, however long it takes }
  145.  
  146. { dispatch parameter to AEResumeTheCurrentEvent takes a pointer to a dispatch
  147. table, or one of these two constants }
  148. kAENoDispatch = 0;
  149. kAEUseStandardDispatch = -1;
  150.  
  151. { Error messages in response to reading and writing event contents }
  152. errAECoercionFail = -1700;
  153. errAEDescNotFound = -1701;
  154. errAECorruptData = -1702;
  155. errAEWrongDataType = -1703;
  156. errAENotAEDesc = -1704;
  157. errAEBadListItem = -1705;           { Specified list item does not exist }
  158. errAENewerVersion = -1706;          { Need newer version of AppleEvent Manager }
  159. errAENotAppleEvent = -1707;         { The event is not in AppleEvent format }
  160.  
  161. { Error messages in response to sending/receiving a message }
  162. errAEEventNotHandled = -1708;       { The AppleEvent was not handled by any handler }
  163. errAEReplyNotValid = -1709;         { AEResetTimer was passed an invalid reply parameter }
  164. errAEUnknownSendMode = -1710;       { Mode wasn't NoReply, WaitReply, or QueueReply;     or Interaction level is unknown }
  165. errAEWaitCanceled = -1711;          { In AESend, User cancelled out of wait loop for  reply or receipt }
  166. errAETimeout = -1712;               { AppleEvent timed out }
  167.  
  168. errAENoUserInteraction = -1713;     { no user interaction allowed }
  169. errAENotASpecialFunction = -1714;   { there is no special function with this keyword }
  170. errAEParamMissed = -1715;           { a required parameter was not accessed }
  171.  
  172. errAEUnknownAddressType = -1716;    { The target address type is not known }
  173. errAEHandlerNotFound = -1717;       { No handler in the dispatch tables fits the parameters to
  174.                                               AEGetEventHandler or AEGetCoercionHandler }
  175.  
  176. errAEReplyNotArrived = -1718;       { the contents of the reply you are accessing have not arrived yet }
  177. errAEIllegalIndex = -1719;          { Index is out of range in a put operation }
  178.  
  179. TYPE
  180. AEKeyword             = PACKED ARRAY [1..4] OF CHAR;
  181. AEEventClass        = PACKED ARRAY [1..4] OF CHAR;
  182. AEEventID             = PACKED ARRAY [1..4] OF CHAR;
  183. DescType = ResType;
  184.  
  185. { tagged data, the standard AppleEvent data type }
  186. AEDesc = RECORD
  187.     descriptorType: DescType;
  188.     dataHandle: Handle;
  189.     END;
  190.  
  191.  
  192. AEAddressDesc = AEDesc;             { an AEDesc which contains addressing data }
  193. AEDescList = AEDesc;                { a list of AEDesc is a special kind of AEDesc }
  194. AERecord = AEDescList;              { AERecord is a list of keyworded AEDesc }
  195. AppleEvent = AERecord;              { an AERecord that contains an AppleEvent }
  196. AESendMode = LONGINT;               { Type of parameter to AESend }
  197. AESendPriority = INTEGER;           { Type of priority param of AESend }
  198.  
  199. { type of param to AEGetInteractionAllowed and AESetInteractionAllowed }
  200. AEInteractAllowed = (kAEInteractWithSelf,kAEInteractWithLocal,kAEInteractWithAll);
  201.  
  202. { Return param to AEGetTheCurrentEvent, and kAEEventSource attribute }
  203. AEEventSource = (kAEUnknownSource,kAEDirectCall,kAESameProcess,kAELocalProcess,
  204.     kAERemoteProcess);
  205.  
  206.  
  207. { types for AppleEvent Array support 
  208.  
  209.  Basic data type of attibutes & parameters}
  210. AEKeyDesc = RECORD
  211.     descKey: AEKeyword;
  212.     descContent: AEDesc;
  213.     END;
  214.  
  215.  
  216. AEArrayType = (kAEDataArray,kAEPackedArray,kAEHandleArray,kAEDescArray,
  217.     kAEKeyDescArray);
  218.  
  219.  
  220. { Array routines support these different types of elements}
  221. AEArrayData = RECORD
  222.     case AEArrayType OF
  223.         kAEDataArray:    
  224.             (AEDataArray:         Array[0..0] OF Integer);
  225.         kAEPackedArray:    
  226.             (AEPackedArray:     Packed Array[0..0] OF Char);
  227.         kAEHandleArray:    
  228.             (AEHandleArray:     Array[0..0] OF Handle);
  229.         kAEDescArray:    
  230.             (AEDescArray:         Array[0..0] OF AEDesc);
  231.         kAEKeyDescArray:    
  232.             (AEKeyDescArray:     Array[0..0] OF AEKeyDesc);
  233.     END;
  234.     
  235. AEArrayDataPointer = ^AEArrayData;
  236.  
  237.  
  238.  
  239. EventHandlerProcPtr = ProcPtr;
  240. IdleProcPtr = ProcPtr;
  241. EventFilterProcPtr = ProcPtr;
  242.  
  243.  
  244. {   *********************************************************************
  245. The following calls apply to any AEDesc. Every result descriptor is created for you,
  246. so you will be responsible for memory management of the descriptors so created.
  247. Purgeable descriptor data is not supported: the AEM does not call LoadResource.   }
  248. FUNCTION AECreateDesc(typeCode: DescType;
  249.                       dataPtr: Ptr;
  250.                       dataSize: Size;
  251.                       VAR result: AEDesc): OSErr;
  252.     INLINE $303C, $0825, $A816;
  253. FUNCTION AECoercePtr(typeCode: DescType;
  254.                      dataPtr: Ptr;
  255.                      dataSize: Size;
  256.                      toType: DescType;
  257.                      VAR result: AEDesc): OSErr;
  258.     INLINE $303C, $0A02, $A816;
  259. FUNCTION AECoerceDesc(theAEDesc: AEDesc;
  260.                       toType: DescType;
  261.                       VAR result: AEDesc): OSErr;
  262.     INLINE $303C, $0603, $A816;
  263. FUNCTION AEDisposeDesc(VAR theAEDesc: AEDesc): OSErr;
  264.     INLINE $303C, $0204, $A816;
  265. FUNCTION AEDuplicateDesc(theAEDesc: AEDesc;VAR result: AEDesc): OSErr;
  266.     INLINE $303C, $0405, $A816;
  267.  
  268. { *********************************************************************
  269.  The following calls apply to AEDescList.
  270.   Since AEDescList is a subtype of AEDesc, the calls in the previous
  271.   section can also be used for AEDescList. All list and array indices are 1-based.
  272.   If the data was greater than maximumSize in the routines below, then actualSize will
  273.   be greater than maximumSize, but only maximumSize bytes will actually be retrieved. }
  274. FUNCTION AECreateList(factoringPtr: Ptr;
  275.                       factoredSize: Size;
  276.                       isRecord: BOOLEAN;
  277.                       VAR resultList: AEDescList): OSErr;
  278.     INLINE $303C, $0706, $A816;
  279. FUNCTION AECountItems(theAEDescList: AEDescList;
  280.                       VAR theCount: LONGINT): OSErr;
  281.     INLINE $303C, $0407, $A816;
  282. FUNCTION AEPutPtr(theAEDescList: AEDescList;
  283.                   index: LONGINT;
  284.                   typeCode: DescType;
  285.                   dataPtr: Ptr;
  286.                   dataSize: Size): OSErr;
  287.     INLINE $303C, $0A08, $A816;
  288. FUNCTION AEPutDesc(theAEDescList: AEDescList;
  289.                    index: LONGINT;
  290.                    theAEDesc: AEDesc): OSErr;
  291.     INLINE $303C, $0609, $A816;
  292. FUNCTION AEGetNthPtr(theAEDescList: AEDescList;
  293.                      index: LONGINT;
  294.                      desiredType: DescType;
  295.                      VAR theAEKeyword: AEKeyword;
  296.                      VAR typeCode: DescType;
  297.                      dataPtr: Ptr;
  298.                      maximumSize: Size;
  299.                      VAR actualSize: Size): OSErr;
  300.     INLINE $303C, $100A, $A816;
  301. FUNCTION AEGetNthDesc(theAEDescList: AEDescList;
  302.                       index: LONGINT;
  303.                       desiredType: DescType;
  304.                       VAR theAEKeyword: AEKeyword;
  305.                       VAR result: AEDesc): OSErr;
  306.     INLINE $303C, $0A0B, $A816;
  307. FUNCTION AESizeOfNthItem(theAEDescList: AEDescList;
  308.                          index: LONGINT;
  309.                          VAR typeCode: DescType;
  310.                          VAR dataSize: Size): OSErr;
  311.     INLINE $303C, $082A, $A816;
  312. FUNCTION AEGetArray(theAEDescList: AEDescList;
  313.                     arrayType: AEArrayType;
  314.                     arrayPtr: AEArrayDataPointer;
  315.                     maximumSize: Size;
  316.                     VAR itemType: DescType;
  317.                     VAR itemSize: Size;
  318.                     VAR itemCount: LONGINT): OSErr;
  319.     INLINE $303C, $0D0C, $A816;
  320. FUNCTION AEPutArray(theAEDescList: AEDescList;
  321.                     arrayType: AEArrayType;
  322.                     arrayPtr: AEArrayDataPointer;
  323.                     itemType: DescType;
  324.                     itemSize: Size;
  325.                     itemCount: LONGINT): OSErr;
  326.     INLINE $303C, $0B0D, $A816;
  327. FUNCTION AEDeleteItem(theAEDescList: AEDescList;
  328.                       index: LONGINT): OSErr;
  329.     INLINE $303C, $040E, $A816;
  330.  
  331. { *********************************************************************
  332. The following calls apply to AERecord.
  333.   Since AERecord is a subtype of AEDescList, the calls in the previous
  334.   sections can also be used for AERecord
  335.   an AERecord can be created by using AECreateList with isRecord set to true  }
  336. FUNCTION AEPutKeyPtr(theAERecord: AERecord;
  337.                      theAEKeyword: AEKeyword;
  338.                      typeCode: DescType;
  339.                      dataPtr: Ptr;
  340.                      dataSize: Size): OSErr;
  341.     INLINE $303C, $0A0F, $A816;
  342. FUNCTION AEPutKeyDesc(theAERecord: AERecord;
  343.                       theAEKeyword: AEKeyword;
  344.                       theAEDesc: AEDesc): OSErr;
  345.     INLINE $303C, $0610, $A816;
  346. FUNCTION AEGetKeyPtr(theAERecord: AERecord;
  347.                      theAEKeyword: AEKeyword;
  348.                      desiredType: DescType;
  349.                      VAR typeCode: DescType;
  350.                      dataPtr: Ptr;
  351.                      maximumSize: Size;
  352.                      VAR actualSize: Size): OSErr;
  353.     INLINE $303C, $0E11, $A816;
  354. FUNCTION AEGetKeyDesc(theAERecord: AERecord;
  355.                       theAEKeyword: AEKeyword;
  356.                       desiredType: DescType;
  357.                       VAR result: AEDesc): OSErr;
  358.     INLINE $303C, $0812, $A816;
  359. FUNCTION AESizeOfKeyDesc(theAERecord: AERecord;
  360.                          theAEKeyword: AEKeyword;
  361.                          VAR typeCode: DescType;
  362.                          VAR dataSize: Size): OSErr;
  363.     INLINE $303C, $0829, $A816;
  364. FUNCTION AEDeleteKeyDesc(theAERecord: AERecord;
  365.                          theAEKeyword: AEKeyword): OSErr;
  366.     INLINE $303C, $0413, $A816;
  367.  
  368.     *********************************************************************
  369.     The following calls are used to pack and unpack parameters from records of
  370.     type AppleEvent. Since AppleEvent is a subtype of AERecord, the calls in the previous
  371.     sections can also be used for variables of type AppleEvent. The next six calls
  372.     are in fact identical to the six calls for AERecord.
  373.  }
  374. FUNCTION AEPutParamPtr(theAppleEvent: AppleEvent;
  375.                        theAEKeyword: AEKeyword;
  376.                        typeCode: DescType;
  377.                        dataPtr: Ptr;
  378.                        dataSize: Size): OSErr;
  379.     INLINE $303C,$0A0F,$A816;
  380. FUNCTION AEPutParamDesc(theAppleEvent: AppleEvent;
  381.                         theAEKeyword: AEKeyword;
  382.                         theAEDesc: AEDesc): OSErr;
  383.     INLINE $303C,$0610,$A816;
  384. FUNCTION AEGetParamPtr(theAppleEvent: AppleEvent;
  385.                        theAEKeyword: AEKeyword;
  386.                        desiredType: DescType;
  387.                        VAR typeCode: DescType;
  388.                        dataPtr: Ptr;
  389.                        maximumSize: Size;
  390.                        VAR actualSize: Size): OSErr;
  391.     INLINE $303C,$0E11,$A816;
  392. FUNCTION AEGetParamDesc(theAppleEvent: AppleEvent;
  393.                         theAEKeyword: AEKeyword;
  394.                         desiredType: DescType;
  395.                         VAR result: AEDesc): OSErr;
  396.     INLINE $303C,$0812,$A816;
  397. FUNCTION AESizeOfParam(theAppleEvent: AppleEvent;
  398.                        theAEKeyword: AEKeyword;
  399.                        VAR typeCode: DescType;
  400.                        VAR dataSize: Size): OSErr;
  401.     INLINE $303C,$0829,$A816;
  402. FUNCTION AEDeleteParam(theAppleEvent: AppleEvent;
  403.                        theAEKeyword: AEKeyword): OSErr;
  404.     INLINE $303C,$0413,$A816;
  405.  
  406. { *********************************************************************
  407. The following calls also apply to type AppleEvent.  Message attributes are far more restricted, and
  408. can only be accessed through the following 5 calls. The various list and record routines cannot be used
  409. to access the attributes of an event.  }
  410. FUNCTION AEGetAttributePtr(theAppleEvent: AppleEvent;
  411.                            theAEKeyword: AEKeyword;
  412.                            desiredType: DescType;
  413.                            VAR typeCode: DescType;
  414.                            dataPtr: Ptr;
  415.                            maximumSize: Size;
  416.                            VAR actualSize: Size): OSErr;
  417.     INLINE $303C,$0E15,$A816;
  418. FUNCTION AEGetAttributeDesc(theAppleEvent: AppleEvent;
  419.                             theAEKeyword: AEKeyword;
  420.                             desiredType: DescType;
  421.                             VAR result: AEDesc): OSErr;
  422.     INLINE $303C,$0826,$A816;
  423. FUNCTION AESizeOfAttribute(theAppleEvent: AppleEvent;
  424.                            theAEKeyword: AEKeyword;
  425.                            VAR typeCode: DescType;
  426.                            VAR dataSize: Size): OSErr;
  427.     INLINE $303C,$0828,$A816;
  428. FUNCTION AEPutAttributePtr(theAppleEvent: AppleEvent;
  429.                            theAEKeyword: AEKeyword;
  430.                            typeCode: DescType;
  431.                            dataPtr: Ptr;
  432.                            dataSize: Size): OSErr;
  433.     INLINE $303C,$0A16,$A816;
  434. FUNCTION AEPutAttributeDesc(theAppleEvent: AppleEvent;
  435.                             theAEKeyword: AEKeyword;
  436.                             theAEDesc: AEDesc): OSErr;
  437.     INLINE $303C,$0627,$A816;
  438.  
  439. { *********************************************************************
  440.  The next four calls are basic routines used to create, send, and process AppleEvents.  }
  441. FUNCTION AECreateAppleEvent(theAEEventClass: AEEventClass;
  442.                             theAEEventID: AEEventID;
  443.                             target: AEAddressDesc;
  444.                             returnID: INTEGER;
  445.                             transactionID: LONGINT;
  446.                             VAR result: AppleEvent): OSErr;
  447.     INLINE $303C,$0B14,$A816;
  448. FUNCTION AESend(theAppleEvent: AppleEvent;
  449.                 VAR reply: AppleEvent;
  450.                 sendMode: AESendMode;
  451.                 sendPriority: AESendPriority;
  452.                 timeOutInTicks: LONGINT;
  453.                 idleProc: IdleProcPtr;
  454.                 filterProc: EventFilterProcPtr): OSErr;
  455.     INLINE $303C,$0D17,$A816;
  456. FUNCTION AEProcessAppleEvent(theEventRecord: EventRecord): OSErr;
  457.     INLINE $303C,$021B,$A816;
  458.  
  459. { During event processing, an event handler may realize that it is likely
  460. to exceed the client's timeout limit. Passing the reply to this
  461. routine causes a wait event to be generated to ask the client for more time.  }
  462. FUNCTION AEResetTimer(reply: AppleEvent): OSErr;
  463.     INLINE $303C,$0219,$A816;
  464.  
  465. {   *********************************************************************
  466. The following four calls are available for applications which need more sophisticated control
  467. over when and how events are processed. Applications which implement multi-session servers or 
  468. which implement their own internal event queueing will probably be the major clients of these
  469. routines.  
  470.  
  471.  Can be called from within a handler to prevent the AEM from disposing of
  472. the AppleEvent when the handler returns. Can be used to asynchronously process the 
  473. event (as in MacApp). }
  474. FUNCTION AESuspendTheCurrentEvent(theAppleEvent: AppleEvent): OSErr;
  475.     INLINE $303C,$022B,$A816;
  476.  
  477.      Tells the AppleEvent manager that processing is either about to resume or has
  478.     been completed on a previously suspended event. The procPtr passed in as the
  479.     dispatcher parameter will be called to attempt to redispatch the event. Several
  480.     constants for the dispatcher parameter allow special behavior. They are:
  481.     - kAEUseStandardDispatch means redispatch as if the event was just received, using the
  482.         standard AppleEvent Dispatcher.
  483.     - kAENoDispatch means ignore the parameter.
  484.         Use this in the case where no redispatch is needed, and the event has been handled.
  485.     - non nil means call the routine which dispatcher points to.
  486.  }
  487. FUNCTION AEResumeTheCurrentEvent(theAppleEvent: AppleEvent;
  488.                                  reply: AppleEvent;
  489.                                  dispatcher: EventHandlerProcPtr;
  490.                                  handlerRefcon: LONGINT): OSErr;
  491.     INLINE $303C,$0818,$A816;
  492.  
  493. { Allows application to examine the currently executing event }
  494. FUNCTION AEGetTheCurrentEvent(VAR theAppleEvent: AppleEvent): OSErr;
  495.     INLINE $303C,$021A,$A816;
  496.  
  497. { Set the current event to the parameter }
  498. FUNCTION AESetTheCurrentEvent(theAppleEvent: AppleEvent): OSErr;
  499.     INLINE $303C,$022C,$A816;
  500.  
  501.     *********************************************************************
  502.      The following three calls are used to allow applications to behave courteously 
  503.     when a user interaction such as a dialog box is needed. 
  504.  }
  505. FUNCTION AEGetInteractionAllowed(VAR level: AEInteractAllowed): OSErr;
  506.     INLINE $303C,$021D,$A816;
  507. FUNCTION AESetInteractionAllowed(level: AEInteractAllowed): OSErr;
  508.     INLINE $303C,$011E,$A816;
  509. FUNCTION AEInteractWithUser(timeOutInTicks: LONGINT;
  510.                             nmReqPtr: NMRecPtr;
  511.                             idleProc: IdleProcPtr): OSErr;
  512.     INLINE $303C,$061C,$A816;
  513.  
  514. {  *********************************************************************
  515.  These calls are used to set up and modify the event dispatch table  }
  516.  
  517. { Add an AppleEvent Handler  }
  518. FUNCTION AEInstallEventHandler(theAEEventClass: AEEventClass;
  519.                                theAEEventID: AEEventID;
  520.                                handler: EventHandlerProcPtr;
  521.                                handlerRefcon: LONGINT;
  522.                                isSysHandler: BOOLEAN): OSErr;
  523.     INLINE $303C,$091F,$A816;
  524.  
  525. {  Remove an AppleEvent Handler  }
  526. FUNCTION AERemoveEventHandler(theAEEventClass: AEEventClass;
  527.                               theAEEventID: AEEventID;
  528.                               handler: EventHandlerProcPtr;
  529.                               isSysHandler: BOOLEAN): OSErr;
  530.     INLINE $303C,$0720,$A816;
  531.  
  532. {  Get the corresponding AppleEvent Handler  }
  533. FUNCTION AEGetEventHandler(theAEEventClass: AEEventClass;
  534.                            theAEEventID: AEEventID;
  535.                            VAR handler: EventHandlerProcPtr;
  536.                            VAR handlerRefcon: LONGINT;
  537.                            isSysHandler: BOOLEAN): OSErr;
  538.     INLINE $303C,$0921,$A816;
  539.  
  540. {  *********************************************************************
  541.  These calls are used to set up and modify the coercion dispatch table   }
  542. FUNCTION AEInstallCoercionHandler(fromType: DescType;
  543.                                   toType: DescType;
  544.                                   handler: ProcPtr;
  545.                                   handlerRefcon: LONGINT;
  546.                                   fromTypeIsDesc: BOOLEAN;
  547.                                   isSysHandler: BOOLEAN): OSErr;
  548.     INLINE $303C, $0A22, $A816;
  549.  
  550. {  Remove a Coercion Handler  }
  551. FUNCTION AERemoveCoercionHandler(fromType: DescType;
  552.                                  toType: DescType;
  553.                                  handler: ProcPtr;
  554.                                  isSysHandler: BOOLEAN): OSErr;
  555.     INLINE $303C, $0723, $A816;
  556.  
  557. {  Get the corresponding Coercion Handler  }
  558. FUNCTION AEGetCoercionHandler(fromType: DescType;
  559.                               toType: DescType;
  560.                               VAR handler: ProcPtr;
  561.                               VAR handlerRefcon: LONGINT;
  562.                               VAR fromTypeIsDesc: BOOLEAN;
  563.                               isSysHandler: BOOLEAN): OSErr;
  564.     INLINE $303C, $0B24, $A816;
  565.  
  566.       *********************************************************************
  567.     These calls are used to set up and modify special hooks into the AppleEvent Manager.
  568.  
  569.     Install the special handler named by the Keyword   }
  570. FUNCTION AEInstallSpecialHandler(functionClass: AEKeyword;
  571.                                  handler: ProcPtr;
  572.                                  isSysHandler: BOOLEAN): OSErr;
  573.     INLINE $303C, $0500, $A816;
  574.  
  575. {  Remove the special handler named by the Keyword  }
  576. FUNCTION AERemoveSpecialHandler(functionClass: AEKeyword;
  577.                                 handler: ProcPtr;
  578.                                 isSysHandler: BOOLEAN): OSErr;
  579.     INLINE $303C, $0501, $A816;
  580.  
  581. {  Get the special handler named by the Keyword  }
  582. FUNCTION AEGetSpecialHandler(functionClass: AEKeyword;
  583.                              VAR handler: ProcPtr;
  584.                              isSysHandler: BOOLEAN): OSErr;
  585.     INLINE $303C, $052D, $A816;
  586.  
  587.  
  588. {$ENDC}    { UsingAppleEvents }
  589.  
  590. {$IFC NOT UsingIncludes}
  591.     END.
  592. {$ENDC}
  593.  
  594.